export class IpcResult<T> {
  success: boolean = true
  msg: string = ''
  data?: T

  constructor(data?: T) {
    this.data = data;
  }

  public static error(msg: string): IpcResult<never> {
    const res = new IpcResult<never>()
    res.msg = msg
    res.success = false
    return res;
  }

  public static success() {
    return new IpcResult();
  }
}